package com.kuang.controller;

import com.kuang.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class RestFulController {
    @RequestMapping("/commit/{p1}/{p2}")
    public String index(@PathVariable int p1, @PathVariable int p2, Model model){
        int result=p1+p2;
        model.addAttribute("mm","结果为:"+result   );
        return "test";
    }
    @RequestMapping("/user")
    public String user(User user){
        System.out.println(user);
        return "hello";
    }
}
